package ltq.stormOld;

import org.apache.storm.Config;
import org.apache.storm.LocalCluster;
import org.apache.storm.topology.TopologyBuilder;

public class TestTopology {
    private static String TelSpoutId="tel-spout";
    private static String TelBoltId="tel-bolt";
    public static void main(String[] args) throws Exception {
        String topologyName=args[0];
//        String filePath=args[1];
        String filePath="stormTestData";
        TopologyBuilder builder=new TopologyBuilder();
        builder.setSpout(TelSpoutId,new TelDataSpout(),1).setNumTasks(1);
        builder.setBolt(TelBoltId,new TelTimeCountBolt(),1)
                .shuffleGrouping(TelSpoutId)
                .setNumTasks(1);

        Config config = new Config();
        LocalCluster local = new LocalCluster();
        local.submitTopology(topologyName, config, builder.createTopology());
    }
}
